from typing import List


class Solution:
    def maxAscendingSum(self, nums: List[int]) -> int:
        ans = 0
        now = 0
        last = 0
        for num in nums:
            if num > last:
                now += num
            else:
                now = num
            last = num
            ans = max(ans, now)
        return ans


if __name__ == "__main__":
    print(Solution().maxAscendingSum([10, 20, 30, 5, 10, 50]))  # 65
    print(Solution().maxAscendingSum([10, 20, 30, 40, 50]))  # 150
    print(Solution().maxAscendingSum([12, 17, 15, 13, 10, 11, 12]))  # 33
    print(Solution().maxAscendingSum([100, 10, 1]))  # 100
